package com.shops.util;

import javax.servlet.http.HttpServletResponse;

import com.alibaba.fastjson.JSONObject;

public class ResponseUtil {

	public static void getResponse(Object object,HttpServletResponse response){
			String jsonString = JSONObject.toJSONString(object);
			//������Ӧ����
			response.setContentType("application/json;charset=utf-8");
			//��json���ҳ��
			try {
				response.getWriter().print(jsonString);
			} catch (Exception e) {
				e.printStackTrace();
			}
		
	}
	public static void getDate(Object object,HttpServletResponse response){
		String jsonString = JSONObject.toJSONStringWithDateFormat(object, "yyyy-MM-dd");
		//������Ӧ����
		response.setContentType("application/json;charset=utf-8");
		//��json���ҳ��
		try {
			response.getWriter().print(jsonString);
		} catch (Exception e) {
			e.printStackTrace();
		}
	
}
}
